$(function(){
  $(".bear-one").hover(function(){
      $(this).attr("src","../images/white-hover.png");
  });
  $(".bear-one").mouseleave(function(){
      $(this).attr("src","../images/white.png");
  });
  $(".bear-two").hover(function(){
      $(this).attr("src","../images/rainbow-hover.png");
  });
  $(".bear-two").mouseleave(function(){
      $(this).attr("src","../images/rainbow.png");
  });
  $(".bear-three").hover(function(){
      $(this).attr("src","../images/brown-hover.png");
  });
  $(".bear-three").mouseleave(function(){
      $(this).attr("src","../images/brown.png");
  });
  $(".bear-four").hover(function(){
      $(this).attr("src","../images/strawberry-hover.png");
  });
  $(".bear-four").mouseleave(function(){
      $(this).attr("src","../images/strawberry.png");
  });
  $(".bear-one").click(function(){
      $(".limit").addClass("bear-container-sale-one");
      $(".limit").removeClass("bear-container-sale-two");
      $(".limit").removeClass("bear-container-sale-three");
      $(".limit").removeClass("bear-container-sale-four");
      $(".bear-one").mouseleave(function(){
          $(this).attr("src","../images/white-hover.png");
      });
      setTimeout(function() {
        $(".bear-one-container .bear-sale").css("display","block");
      },1000);
      setTimeout(function() {
        $(".bear-two-container,.bear-three-container,.bear-four-container").css("visibility","hidden");
      },2000);
  });
  $(".bear-one-container .close").click(function(){
      $(".limit").removeClass("bear-container-sale-one");
      
  });
  $(".bear-two").click(function(){
      $(".limit").addClass("bear-container-sale-two");
      $(".limit").removeClass("bear-container-sale-one");
      $(".limit").removeClass("bear-container-sale-three");
      $(".limit").removeClass("bear-container-sale-four");
      $(".bear-two").mouseleave(function(){
          $(this).attr("src","../images/rainbow-hover.png");
      });
      setTimeout(function() {
        $(".bear-two-container .bear-sale").css("display","block")
      },1000);
      setTimeout(function() {
        $(".bear-one-container,.bear-three-container,.bear-four-container").css("visibility","hidden");
      },2000);
  });
  $(".bear-two-container .close").click(function(){
      $(".limit").removeClass("bear-container-sale-two");
  });
  $(".bear-three").click(function(){
      $(".limit").addClass("bear-container-sale-three");
      $(".limit").removeClass("bear-container-sale-two");
      $(".limit").removeClass("bear-container-sale-four");
      $(".limit").removeClass("bear-container-sale-one");
      $(".bear-three").mouseleave(function(){
          $(this).attr("src","../images/brown-hover.png");
      });
      setTimeout(function() {
        $(".bear-three-container .bear-sale").css("display","block")
      },1000);
      setTimeout(function() {
        $(".bear-two-container,.bear-one-container,.bear-four-container").css("visibility","hidden");
      },2000);
  });
  $(".bear-three-container .close").click(function(){
      $(".limit").removeClass("bear-container-sale-three");
  });
  $(".bear-four").click(function(){
      $(".limit").addClass("bear-container-sale-four");
      $(".limit").removeClass("bear-container-sale-two");
      $(".limit").removeClass("bear-container-sale-three");
      $(".limit").removeClass("bear-container-sale-one");
      $(".bear-four").mouseleave(function(){
          $(this).attr("src","../images/strawberry-hover.png");
      });
      setTimeout(function() {
        $(".bear-four-container .bear-sale").css("display","block")
      },1000);
      setTimeout(function() {
        $(".bear-two-container,.bear-three-container,.bear-one-container").css("visibility","hidden");
      },2000);
  });
  $(".bear-four-container .close").click(function(){
      $(".limit").removeClass("bear-container-sale-four");
  });
  $(".close").click(function(){
      $(".bear-container span").css("visibility","visible");
      $(".bear-one").mouseleave(function(){
          $(this).attr("src","../images/white.png");
      });
      $(".bear-two").mouseleave(function(){
          $(this).attr("src","../images/rainbow.png");
      });
      $(".bear-three").mouseleave(function(){
          $(this).attr("src","../images/brown.png");
      });
      $(".bear-four").mouseleave(function(){
          $(this).attr("src","../images/strawberry.png");
      });
      setTimeout(function() {
        $(".bear-sale").css("display","none")
      },1000);
  });
})